package com.mcptt.config.body.info.mcptt;

import com.cloudptt.api.product.func.call.CallAttr;

import java.io.UnsupportedEncodingException;

public class McpttInfoBody_RequestCall extends McpttInfoBody{

	private String cmdType = "";
	private String selfMcpttId = "";
	public McpttInfoBody_RequestCall(String cmdType,String selfMcpttId)
	{
		this.cmdType = cmdType;
		this.selfMcpttId = selfMcpttId;
	}

	public String toString()
	{
		StringBuffer strBuff = new StringBuffer();
		strBuff.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>").append("\r\n");
		strBuff.append("<mcpttinfo xmlns=\"urn:3gpp:ns:mcpttInfo:1.0\">").append("\r\n");
		strBuff.append("<mcptt-Params>").append("\r\n");

		strBuff.append("<mcptt-called-party-id type=\"Normal\">").append("\r\n");
		strBuff.append("<mcpttURI>").append(selfMcpttId).append("</mcpttURI>").append("\r\n");
		strBuff.append("</mcptt-called-party-id>").append("\r\n");

		strBuff.append("<anyExt>").append("\r\n");
		strBuff.append("<request-type>").append(cmdType).append("</request-type>").append("\r\n");
		strBuff.append("<notify-remote-user>").append("true").append("</notify-remote-user>").append("\r\n");
		strBuff.append("</anyExt>").append("\r\n");


		strBuff.append("</mcptt-Params>").append("\r\n");
		strBuff.append("</mcpttinfo>").append("\r\n");

		try {
			return new String(strBuff.toString().getBytes(),"UTF-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return strBuff.toString();
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
